const webpack = require('webpack')
const target = process.env
module.exports = {
  devServer: {
    // 所有的接口请求代理
    proxy: {
      '/api': {
        target: target,
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^api': ''
        }
      },
      '/pdzhyl/': {
        target: 'http://117.131.40.182:8760/pdzhyl/',
        // target: 'http://10.2.104.177:8094/pdzhyl/',
        changeOrigin: true,
        pathRewrite: {
          '^/pdzhyl/': ''
        }
      },
    }
  },
  configureWebpack: {
    externals: {
      AMap: 'AMap',
      AMapUI: 'AMapUI'
    },
    plugins: [
      new webpack.ProvidePlugin({
        jQuery: "jquery",
        $: "jquery",
        'windows.jQuery': 'jquery'
      })
      /*new webpack.ProvidePlugin({
        jQuery: 'jquery',
        $: 'jquery',
        'windows.jQuery': 'jquery'
      })*/
    ]
  },
  publicPath: process.env.NODE_ENV === 'production'
      ? '/pudongdp/binzang/'
      : '/'
}
